<template>
	<div class="person">
		<h2>我是Person组件</h2>
		<h3>人名：{{name}}</h3>
		<button @click="handleClick">触发一下$bus的xxx事件</button>
	</div>
</template>

<script>
	export default {
		name:'Person',
		data() {
			return {
				name:'张三'
			}
		},
		mounted() {
			console.log('Person组件挂载了')
		},
		methods: {
			handleClick(){
				this.$bus.$emit('xxx')
			}
		},
	}
</script>

<style scoped>
	.person{
		background-color: orange;
		padding: 20px;
	}
</style>